package com.cn.qtms.entity;//类注释设置模板

import com.cn.qtms.entity.vo.CouponNoVo;
import com.cn.qtms.entity.vo.UserVo;
import com.cn.qtms.util.poi.ExcelUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.ArrayList;
import java.util.List;

/**
 * @Name:ExportTest 测时方法 测试一个多sheet的导出
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-12-01 9:18
 **/
public class ExportTest {
    public static void main(String[] args) {
        List<UserVo> userList=new ArrayList<>();
        userList.add(new UserVo("张三","123","男"));
        userList.add(new UserVo("李四","123","男"));
        userList.add(new UserVo("王五","123","男"));
        userList.add(new UserVo("赵六","123","男"));

        List<CouponNoVo> couponNoVoList=new ArrayList<>();
        couponNoVoList.add(new CouponNoVo("123",""));
        couponNoVoList.add(new CouponNoVo("124",""));
        couponNoVoList.add(new CouponNoVo("125",""));
        Workbook wb= new XSSFWorkbook();
        ExcelUtils.excelExport(wb,0,userList,UserVo.class);
        ExcelUtils.excelExport(wb,1,couponNoVoList,CouponNoVo.class);
        ExcelUtils.buildExcelFile("F:\\test.xlsx",wb);
    }
}
